<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script src="../node_modules/ejs/ejs.js"></script>
    <script id="users" type="text/template">
        <% if (names.length) { %>
            <ul>
                <% names.forEach(function(name){ %>
                    <li>
                        <%= name %>
                    </li>
                    <% }) %>
            </ul>
            <% } %>
    </script>
    <script>
        onload = function() {
            var users = document.getElementById('users').innerHTML;
            var names = ['loki', 'tobi', 'jane'];
            var html = ejs.render(users, {
                names: names
            });
            document.body.innerHTML = html;
        }
    </script>

</body>

</html>